package com.bizdk.fastfx.fxsupport;

import javafx.scene.Parent;
import javafx.stage.Stage;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

/**
 * state 管理工具类，暂时没有想到做什么
 */
@Component
public class StageManager {

    private static Set<Stage> stageClt = new HashSet<>();

    public static void register(Stage stage){
        stageClt.add(stage);
    }

    public static void close(Stage stage) {
        for (Stage stageTmp : stageClt) {
            if (stageTmp.equals(stage)) {
                stageTmp.close();
            }
        }
    }
}